package com.woniuxy.controller;


import com.woniuxy.controller.form.GetCommentByTopicId;
import com.woniuxy.controller.form.TopicCommentForm;
import com.woniuxy.controller.info.Result;
import com.woniuxy.service.CommentService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Kevin Martin
 * @since 2022-03-19
 */
@RestController
@RequestMapping("/comment")
public class CommentController {
    @Resource
    private CommentService commentService;


    @GetMapping("getCommentByTopicId")
    public Result getCommentByTopicId(GetCommentByTopicId getCommentByTopicId){
        return commentService.getCommentByTopicId(getCommentByTopicId);
    }

    @PostMapping("addTopicComment")
    public Result addTopicComment(@RequestBody TopicCommentForm topicCommentForm){
        return commentService.addTopicComment(topicCommentForm);
    }
}

